package com.tt.fashionWebSite.dao.jpa;

import com.tt.fashionWebSite.dao.LuatDao;
import com.tt.fashionWebSite.domain.DanhMucBaiViet;
import com.tt.fashionWebSite.domain.Luat;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository("luat")
public class LuatJpaDao extends GenericJpaDao<Luat,String> implements LuatDao {
    public LuatJpaDao(){
        super(Luat.class);
    }

    @Override
    public List<Luat> getLawHypothesis(){
        return getEntityManager().createNamedQuery(Luat.GET_INFO_LAWHYPOTHESIS, Luat.class).getResultList();
//        return getEntityManager().createNamedQuery(Luat.GET_INFO_LAWHYPOTHESIS, Luat.class)
//                .setParameter("patientId", "0")
//                .getResultList();
    }

    @Override
    public List<Luat> getLawReason(){
        return getEntityManager().createNamedQuery(Luat.GET_INFO_LAWREASON, Luat.class).getResultList();
//        return getEntityManager().createNamedQuery(Luat.GET_INFO_LAWREASON, Luat.class)
//                .setParameter("patientId", "1")
//                .getResultList();
    }
}
